package com.xiaolin.renju.controller;

import com.xiaolin.renju.pojo.HttpData;
import com.xiaolin.renju.service.RenJuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhengjin.liu
 * @since 2021/12/2 16:32
 */
@RestController
@RequestMapping("/api")
public class RenJuController {

    @Autowired
    private RenJuService service;

    @PostMapping("/start")
    public HttpData start(@RequestBody HttpData data) {
        return service.start(data);
    }

    @PostMapping("/begin")
    public HttpData begin(@RequestBody HttpData data) {
        return service.begin(data);
    }

    @PostMapping("/turn")
    public HttpData turn(@RequestBody HttpData data) {
        return service.turn(data);
    }

    @PostMapping("/beat")
    public HttpData beat(@RequestBody HttpData data) {
        return service.beat(data);
    }

    @PostMapping("/takeBack")
    public HttpData takeBack(@RequestBody HttpData data) {
        return service.takeBack(data);
    }

}
